/*
 * Copyright 2006-2022 ahtelit.com, All Rights Reserved.
 */

package com.telit.uav.feign;

import com.telit.common.entity.DataReturn;
import com.telit.uav.feign.factory.RemoteUavServiceFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;


/**
 * uav feign
 *
 * @author yuezhuang
 * @since 2022-12-14
 */
@FeignClient(contextId = "remoteUavService", name = "yichang-uav", fallbackFactory = RemoteUavServiceFallbackFactory.class)
public interface RemoteUavService {

    @GetMapping("/uav/uav-query/querySimpleDataByCondition")
    @ApiOperation("根据经纬度、半径查询无人机指定列表")
    DataReturn querySimpleDataByCondition(@RequestParam(value = "radius") String radius,
                                          @RequestParam(value = "longitude") String longitude,
                                          @RequestParam(value = "latitude") String latitude,
                                          @RequestParam(required = false, value = "flag") String flag);

    @GetMapping("/uav/uav-query/querySubTaskNumber")
    @ApiOperation("根据不同状态查询子任务数量")
    DataReturn querySubTaskNumber(@RequestParam("taskId") Long taskId, @RequestParam("status") String status);

    //    @GetMapping("/uav/uav-query/querySubTaskNumber")
    @GetMapping("/uav/uav-query//queryDelayNumber")
    @ApiOperation("查询逾期任务数量")
    DataReturn queryDelayNumber(@RequestParam("taskId") Long taskId, @RequestParam("endTime") Date endTime);

    @GetMapping("/uav/uav-query/queryCruisePointCollection")
    @ApiOperation("查询轨迹")
    DataReturn queryCruisePointCollection(@RequestParam("taskId") Long taskId, @RequestParam("userId") Long userId);

    @GetMapping(value = "/uav/app-cruise-track/count", produces = "application/json;charset=UTF-8")
    @ApiOperation("巡航轨迹统计数据")
    DataReturn cruiseTrackInfo();

    @GetMapping(value = "/uav/uav-query/flyDetail/{userId}/{taskId}", produces = "application/json;charset=UTF-8")
    @ApiOperation("查看某一任务无人机飞行详情")
    DataReturn flyingDetail(@PathVariable("userId") Long userId, @PathVariable("taskId") Long taskId);


    @PostMapping(value = "/uav/app-cruise-track/countByUserId", produces = "application/json;charset=UTF-8")
    @ApiOperation("巡航轨迹统计数据")
    DataReturn cruiseTrackInfoByUserId(@RequestBody List<Long> ids);

    @PostMapping(value = "/uav/app-cruise-track/selectcountByUserId", produces = "application/json;charset=UTF-8")
    @ApiOperation("首页无人机巡航总次数")
    DataReturn selectcountByUserId(@RequestBody List<Long> ids);





}
